package com.openapi.config;

import com.openapi.protocol.Server;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.CommandLineRunner;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class ServerConfig implements CommandLineRunner {
    private static final Logger logger = LoggerFactory.getLogger(ServerConfig.class);


    @Value("${video.serviceAPI}")
    private String serviceAPI;
    @Value("${video.ServerPort}")
    private int ServerPort;

    @Autowired
    private  RedisConfig redisConfig;


    @Override
    public void run(String... args) throws Exception{
        new Thread(new Server(ServerPort, serviceAPI,redisConfig)).start();

        logger.info("视频服务启动成功！");

    }
}
